package com.jing.countmvvmdemo.viewModel.factory;


import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

import com.jing.countmvvmdemo.viewModel.CountViewModel;

public class CounterViewModelFactory implements ViewModelProvider.Factory {
    private int initialCount;

    public CounterViewModelFactory(int initialCount) {
        this.initialCount = initialCount;
    }

//    @NonNull
//    @Override
//    public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
//        if (modelClass.isAssignableFrom(CountViewModel.class)) {
//            return (T) new CountViewModel(initialCount);
//        }
//        throw new IllegalArgumentException("Unknown ViewModel class");
//    }
}
